package com.example.concurrency.thread01_template_method2;

/**
 * @description: 模板方法具体实现类
 * @program: demos
 * @author: dove
 * @date: 2020-12-02 23:44
 **/

public class MyCook extends Cook{

    private boolean isAddOil;
    private boolean isAddEgg;
    private boolean isAddTomato;

    public MyCook(boolean isAddOil, boolean isAddEgg, boolean isAddTomato){
        this.isAddOil = isAddOil;
        this.isAddEgg = isAddEgg;
        this.isAddTomato = isAddTomato;
    }

    @Override
    boolean isAddOil() {
        return this.isAddOil;
    }

    @Override
    boolean isAddEgg() {
        return this.isAddEgg;
    }

    @Override
    boolean isAddTomato() {
        return this.isAddTomato;
    }

    @Override
    void oil() {
        System.out.println("记得多放油！");
    }

    @Override
    void egg() {
        System.out.println("需要两个鸡蛋！");
    }

    @Override
    void tomato() {
        System.out.println("需要一个西红柿！");
    }
}
